#!/usr/bin/expect

spawn build/bin/observer -f etc/observer.ini -P cli 
expect "miniob >"
send "drop table t\r"
expect "miniob >"
send "create table t(id int, num int nullable, birthday date nullable);\r"
expect "miniob >"
send "insert into t values(1, 2, '2020-01-01');\r"
expect "miniob >"
send "insert into t values(1, null, null);\r"
expect "miniob >"
send "insert into t values(1, null, '2020-02-02');\r"
expect "miniob >"
send "insert into t values(null, 1, '2020-01-02');\r"
expect "miniob >"
send "select * from t;\r"
expect "miniob >"
send "select * from t where num > null;\r"
expect "miniob >"
send "select * from t where num <> null;\r"
expect "miniob >"
send "select * from t where 1=null;\r"
expect "miniob >"
send "select * from t where 'a'=null;\r"
expect "miniob >"
send "select * from t where null = null;\r"
expect "miniob >"
send "select count(*) from t;\r"
expect "miniob >"
send "select count(num) from t;\r"
expect "miniob >"
send "select avg(num) from t;\r"
expect "miniob >"
send "select * from t where id is null;\r"
expect "miniob >"
send "select * from t where id is not null;\r"
expect "miniob >"
send "select * from t where num is null;\r"
expect "miniob >"
send "select * from t where null = null;\r"
expect "miniob >"
send "select * from t where null is null;\r"
expect "miniob >"
send "select * from t where '2020-01-31' is null;\r"
interact